from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext 
from blog.models import Post
 
def postindex(request):
    all_posts = Post.objects.filter(active=True)
  
 
    return render_to_response('blog/index.html',{
        'all_posts': all_posts 
    }, context_instance=RequestContext(request))
    
    
def postsingle(request, slug):

    single_post = Post.objects.filter(active=True, slug=slug)
    
    

    return render_to_response('blog/blog_post.html',{
        'single_post': single_post,
        
    }, context_instance=RequestContext(request))
    
   